package com.wlhse.entity;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import com.wlhse.dto.getDto.BaseGetDto;

@Component
public class ProblemDescriptionPojo extends BaseGetDto implements Cloneable {

    @Value("${PROBLEM_RANK_LIGHT_SCORE}")
    private String lightScore;

    @Value("${PROBLEM_RANK_LIGHT_PENALTY}")
    private String lightPenalty;

    @Value("${PROBLEM_RANK_SAME_SCORE}")
    private String sameScore;

    @Value("${PROBLEM_RANK_SAME_PENALTY}")
    private String samePenalty;

    @Value("${PROBLEM_RANK_MORE_SCORE}")
    private String moreScore;

    @Value("${PROBLEM_RANK_MORE_PENALTY}")
    private String morePenalty;

    @Value("${PROBLEM_RANK_MAJOR_SCORE}")
    private String majorScore;

    @Value("${PROBLEM_RANK_MAJOR_PENALTY}")
    private String majorPenalty;

    private Integer id;
    private String problemDescriptionCode;//问题描述编码
    private String description;//描述
    private String problemRank;//问题级别
    private String recommendRectiMeasure;//问题建议整改措施
    private String verifyDescription;//问题验证描述

    private String score;
    private String penalty;

    public ProblemDescriptionPojo() {
    }

    public void setProblemDescriptionPojo(String problemDescriptionCode, String description, String problemRank) {
        this.problemDescriptionCode = problemDescriptionCode;
        this.description = description;
        this.problemRank = problemRank;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getProblemDescriptionCode() {
        return problemDescriptionCode;
    }

    public void setProblemDescriptionCode(String problemDescriptionCode) {
        this.problemDescriptionCode = problemDescriptionCode;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getProblemRank() {
        return problemRank;
    }

    public void setProblemRank(String problemRank) {
        this.problemRank = problemRank;
    }

    public String getRecommendRectiMeasure() {
        return recommendRectiMeasure;
    }

    public void setRecommendRectiMeasure(String recommendRectiMeasure) {
        this.recommendRectiMeasure = recommendRectiMeasure;
    }

    public String getVerifyDescription() {
        return verifyDescription;
    }

    public void setVerifyDescription(String verifyDescription) {
        this.verifyDescription = verifyDescription;
    }

    public Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    public String[] getScorePenalty(String problemRank) {
        String[] str = new String[2];
        switch (problemRank) {
            case "轻微":
                str[0] = lightScore;
                str[1] = lightPenalty;
                break;
            case "一般":
                str[0] = sameScore;
                str[1] = samePenalty;
                break;
            case "较大":
                str[0] = moreScore;
                str[1] = morePenalty;
                break;
            case "重大":
                str[0] = majorScore;
                str[1] = majorPenalty;
                break;
            default:
                str[0] = "0";
                str[1] = "0";
                break;
        }
        return str;
    }
}
